import { h, render } from "vue";
import Relogin from "./Relogin.vue";

interface LoginTexts {
  username: string;
  password: string;
}

export type LoginText = LoginTexts;

/**
 * @param {*} title 标题
 */
export const relogin = () => {
  return new Promise(resolve => {
    // 关闭弹层事件
    const close = () => {
      render(null, document.body);
      resolve(1);
    };

    const param: any = {
      show: true,
      close
    };

    // 1. 生成 vnode
    const vnode = h(Relogin, param);

    // 2. render 渲染
    render(vnode, document.body);
  });
};
